#ifndef __BB_SQLITESTORAGE_H__
#define __BB_SQLITESTORAGE_H__

// BalanceBook imports.
#include <bbIStorage.h>

// Mozilla imports.
#include <mozIStorageConnection.h>
#include <nsCOMPtr.h>
#include <nsILocalFile.h>

#define BB_SQLITESTORAGE_CLASSNAME "bbSQLiteStorage"
#define BB_SQLITESTORAGE_CONTRACTID "@balancebook.com/storage/sqlite;1"
#define BB_SQLITESTORAGE_CID                               \
  { /* 18ea8d01-39eb-422e-bff0-84ebde426d49 */             \
    0x18ea8d01,                                            \
    0x39eb,                                                \
    0x422e,                                                \
    { 0xbf, 0xf0, 0x84, 0xeb, 0xde, 0x42, 0x6d, 0x49 }     \
  }

class bbSQLiteStorage : public bbIStorage
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_BBISTORAGE

  bbSQLiteStorage();
  virtual ~bbSQLiteStorage();

private:
  nsresult openDBConnection(nsILocalFile *aSqlFile);
  nsresult closeDBConnection();

  nsCOMPtr<mozIStorageConnection> mDbConn;

};

#endif // __BB_SQLITESTORAGE_H__
